<{include file="section/admin/admin_header.tpl"}>
<style>
.boxform_1 {
    margin-top: 13px;
}
.boxform_1  li {
    color: #333333;
    float: left;
    line-height: 20px;
    padding-top: 8px;
}
.boxform_1  li.i1 {
    color: #034795;
    text-align: right;
    width: 90px;
}
.boxform_1  li.i2 {
    width: 600px;
}
.boxform_1  li p {
    line-height: 26px;
}
.boxform_1  .line {
    margin: 13px 0;
}

</style>
<script type="text/javascript" src="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/admin/brand_category.js"></script>
<script type="text/javascript" src="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/upimage.js"></script>
<script>
var brand_category=new Brand_category();
$(document).ready ( function () { upimage.init_async_upload('<{$async_vars.init_url}>',  '<{$async_vars.post_url}>'); } ); 
</script>
<body>
<{include file="section/admin/admin_header_login_bar.tpl"}>
<div id="contentA" class="clear" style="width:1300px;">
	<!--leftsidebar sr-->
	<{include file="section/admin/admin_left_sidebar.tpl"}>
    <!--/leftsidebar end-->
    <div class="rightCont">
    	<!--path st-->
		<div class="path">您的位置：<a href="/">首页</a>&gt; <a href="/brands/list" target="_blank">品牌管理</a> &gt; 新增品牌</div>
		<!--/path end-->
		
		<{$message}>

    	<h2 class="title01"><span>新增品牌</span></h2>
        <div class="line1"></div>
		<div class="boxform_1">
			<form action="/brands/insert" method="post" name="frm" id="frm" enctype="multipart/form-data">
			<input type="hidden" name="category_sys" id="category_sys" value="">
			<ul class="clear">
            <li class="i1"><span class="red">*</span> 品牌名称：</li>
            <li><span class="in"><input type="text" name="brand_name" class="in2" onblur="this.className='in2'" onfocus="this.className='in1'" value="" style="width:177px;" id="brand_name"/></span></li>
            </ul>
                        
			<!--增加品牌层 start-->
			<span class="brand_init" style="display:none;">
				<div class="brand_main" style="display:block;width:100%;">	
					<ul>
						<li class="i1"><span class="red">*</span> 品牌分类：</li>
						<li class="t">
							<span class="frm">
								<select class='category_sys_1' style="width:100px;margin-right:10px" name="category_sys_1[]"  onchange="brand_category.change_catesys(this, '.category_sys_2',1)">
									<option value=''>一级分类</option>
									<{foreach from=$category_sys_1 item=item}>
										<option value="<{$item.id}>"><{$item.cate_name}></option>
									<{/foreach}>
								</select>
								<select class="category_sys_2" style="width:100px;margin-right:10px" name="category_sys_2[]" onchange="brand_category.change_catesys(this, '.category_sys_3',2)">
									<option value=''>二级分类</option>
								</select>
							</span>
						</li>
					<li class="delete_curr_brand" ><a href="javascript:void(0);"  onclick="brand_category.delete_curr_brand_html(this)";>删除当前品牌分类</a></li>
					<li style="clear:both;height:0px;overflow:hidden;"></li>
					</ul>
				</div>
			</span>
			<!--增加品牌层 end-->

				<ul> 
					<li class="i1"><span class="red">*</span> 品牌分类：</li>
					<li class="t">
						<span class="frm">
							<select class='category_sys_1' id="category_sys_1" style="width:100px;margin-right:10px" name="category_sys_1[]"  onchange="brand_category.change_catesys(this, '.category_sys_2',1)">
								<option value=''>一级分类</option>
								<{foreach from=$category_sys_1 item=item}>
									<option value="<{$item.id}>"><{$item.cate_name}></option>
								<{/foreach}>
							</select>
							<select class="category_sys_2" style="width:100px;margin-right:10px" name="category_sys_2[]" onchange="brand_category.change_catesys(this, '.category_sys_3',2)">
								<option value=''>二级分类</option>
							</select>
						</span>
					</li>
				</ul>
			<ul class="clear"></ul>
			<div class='brand_new_add_1'>
			</div>

			<ul class="clear">
            <li class="i1"><span class="red"></span></li>
			<li ><span class="in"><a onclick="return brand_category.add_brand_html();" href="javascript:void(0)" class="btn"><span>新增分类</a></span>　
</span></li>
			</ul>

			<ul class="clear">
            <li class="i1"><span class="red">*</span> 图　　片：</li>
            <li><span class="in"><input id="brand_logo" name="brand_logo" type="file" class="in" style="width:130px" /></span></li> 
			</ul>
            <ul class="clear">
            <li class="i1">描    述：</li>
            <li><textarea name="description" cols="45" rows="8"></textarea></li>
            </ul>
            <div class="line margin25"></div>
            <ul class="clear">
            <li class="i1">&nbsp;</li>
            <li>
            	<input type="button" onclick="check_form();" name="sure" class="btn04" value="确　定"/>　<input type="reset" class="btn04" value="取　消" />
            </li>
            </ul>
			</form>
        </div>
        
    </div>
</div>
</body>
<script type="text/javascript">
var frm = document.getElementById('frm');

function check_form()
{
	var brand_name	= $('#brand_name').val();

	var brand_logo	= $('#brand_logo').val();

	if(brand_name && brand_logo)
	{
		return upimage.image_upload_ready(frm);

		//frm.submit();
	}else
		alert('参数错误！');	
	return false;

}

</script>
</html>
